1. Field of the Invention
The invention relates to a method of transforming a digital image having several gray levels into a binary image in which each pixel is coded over one bit. It applies most particularly to automatic mail processing machines. In the automatic processing of mail, it is usual to provide a camera between the unit for taking mail items from the stack and the unit for sorting these mail items, this camera producing a digital image with several gray levels of the face of each mail item on which the destination address of the mail is printed. This digital image having several gray levels is used to carry out automatic recognition of the characters of the address and subsequently automatic reading of the address so as to operate the downstream sorting unit.
2. Description of the Prior Art
The automatic character recognition processes are applied to binarized images, that is to say images in which each pixel is coded over a single bit. In the digital image with several gray levels, each pixel is generally coded over one byte, that is to say over eight bits.
Hitherto, to transform a digital image having several gray levels into a binary image, the mail processing sector has made use of processing by dynamic thresholding consisting in calculating, for each pixel of the digital image having several gray levels, the local contrast level within a certain neighborhood of this pixel, this contrast level making it possible to calculate a local threshold with which the gray level of the pixel is compared for the coding of the corresponding pixel in the binary image. For example, if the gray level of the current pixel is less than or equal to the local contrast level of this pixel, the corresponding pixel of the binary image is white and in the converse case it is black. The binary image therefore comprises only black or white pixels. There are other processes for binarizing a digital image having several gray levels, for example the static thresholding process according to which the gray level of each pixel of the image to be binarized is compared with a fixed threshold or else processes using operators such as the gradient, the Laplacian, the standard deviation, etc.
Within the postal mail sector, the characters printed on the mail items exhibit great variability which is due to the local practices of each country as regards the printing of addresses on mail items as well as to the use of different printing supports. It follows that by applying the same binarization process to a wide spectrum of mail items, a great diversity is obtained in the quality of the binary images. The latter do not always retain the original geometrical structure or the connectedness of the characters of the images having several gray levels. The interconnecting of the characters, when they are very close together, and their sinkage, when they are abnormally thick are not always taken into account in the binary images. Likewise, the weak contrasts which may constitute elements characteristic of the shape of the characters are not always recovered within the binary image whereas smudges on the character printing support may be recovered within the binary image.
The aim of the invention is therefore to propose a method for transforming a digital image having several gray levels into a binary image which remedies the drawbacks indicated above.